//
//  HNCourseListSeeTeacherCell.m
//  优学荟管理系统
//
//  Created by edz on 2017/10/31.
//  Copyright © 2017年 星道三好. All rights reserved.
//

#import "HNCourseListSeeTeacherCell.h"

@implementation HNCourseListSeeTeacherCell
{
    // 头像
    __weak IBOutlet UIImageView *_Img;
    // 老师名称
    __weak IBOutlet UILabel *_Name;
    // 删除按钮
    __weak IBOutlet UIButton *_DeleteButton;
}


/** Setter方法 */
- (void)setModel:(HNCourseListSeeTeacherModel *)Model {
    
    _Model = Model;
    _Name.text = _Model.petName;
    [_Img sd_setImageWithURL:[NSURL URLWithString:_Model.avatar]];
    // 控制删除按钮是否隐藏
    _DeleteButton.hidden = !_Model.IsShowDelete;
}


/** 点击了删除老师 */
- (IBAction)ClickDelete:(UIButton *)sender {
    
    // block去控制器里面实现删除
    self.ClickDeleteTeacher ? self.ClickDeleteTeacher(self.Model):nil;
}

- (void)layoutSubviews {
    
    [super layoutSubviews];
    
    _Img.layer.cornerRadius = _Img.bounds.size.width/2;
    _Img.layer.masksToBounds = YES;
}
@end
